-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(docs): add steps to call SOAP services #2588
Conversation
"wsdl": "http://calculator-webservice.mybluemix.net/calculator?wsdl", | ||
"remotingEnabled": true, | ||
// ADD THIS SNIPPET | ||
"operations": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@strongloop/loopback-maintainers , do I need to add this? I tried without this snippet and it seems to be working fine. I initially thought that by specifying the operations
here, there's less code I need to write in the Service class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The operations
is for customizing the method names. See https://loopback.io/doc/en/lb3/SOAP-connector.html#operations-property.
Otherwise, the method name is built from serviceName + portName + operationName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @raymondfeng. The problem I'm having now is that the method name I'm setting here doesn't seem to be used for generating the methods inside the service interface, i.e. no matter what I set under the operations
attribute, it's not being referenced in the code. Is it where it's being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not automatically update CalculatorService
interface but the method names of the service proxy are impacted. We have yet to generate strongly-typed interface from the SOAP WS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried without this snippet and it seems to be working fine.
It would be good to hint the developer at the command line about these properties and mark them as (optional)
``` | ||
|
||
For details, you can refer to the SOAP connector's operations property: | ||
https://github.com/strongloop/loopback-connector-soap#operations-property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will change it to https://loopback.io/doc/en/lb3/SOAP-connector.html#operations-property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new content looks mostly good. However, I am confused about the new structure of this doc page:
- Calling SOAP web services
- Add a datasource
- Add a service
- Add a Controller
- Installation
- Usage
- Define a data source for the service backend
- Declare the service interface
- Declare service proxies for your controller
- Make service proxies easier to test
IMO, you should rethink the overall structure of this doc page and decide which content will be shared for all services and which content is specific to SOAP/REST/etc. connectors.
@bajtos , thanks for the review. I had a question about the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the new structure 👍
Do we want to preserve information about @serviceProxy
decorator?
Also the original content was mentioning ServiceMixin
that should be applied on the application class, I think it would be good to preserve it. IIUC, your tutorial expects that the application was scaffolded with "services" options enabled. Could you please run it against a new application that was scaffolded without "services" integration, to see if there are any missing steps to document?
621b4f1
to
5979bd6
Compare
@bajtos, I've incorporated your feedback. Also, I've updated the LB3 LTS date as part of this PR. |
@slnode test please |
It usually better to open a new pull request for such an unrelated change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great.
Fixes #1766
Description
UPDATED 3/14/2019
The Calling other APIs docs page is updated because we no longer need to manually install
@loopback/service-proxy
. Instead, we can uselb4 service
.The code snippets and instructions are verified with my repo: https://github.com/dhmlau/loopback4-external-apis.
Old description
Since we no longer need to install
@loopback/service-proxy
manually and can uselb4 service
instead, I'm updating this doc: https://loopback.io/doc/en/lb4/Calling-other-APIs-and-web-services.html.I think my changes can be generalized to be used for calling REST APIs as well, just that the datasource generation will be different. Will need some work on that.
This is currently a draft PR, because I have a question:
Maps WSDL binding operations to Node.js methods
when creating datasource? (see my comment in the actual code changes)